package com.ruoyi.oiltank.mapper;

import java.math.BigDecimal;
import java.util.List;
import com.ruoyi.oiltank.domain.OilTank;
import org.apache.ibatis.annotations.Select;

/**
 * 储油罐信息Mapper接口
 * 
 * @author ruoyi
 * @date 2024-10-11
 */
public interface OilTankMapper 
{
    /**
     * 查询储油罐信息
     * 
     * @param id 储油罐信息ID
     * @return 储油罐信息
     */
    public OilTank selectOilTankById(Long id);

    /**
     * 查询储油罐信息列表
     * 
     * @param oilTank 储油罐信息
     * @return 储油罐信息集合
     */
    public List<OilTank> selectOilTankList(OilTank oilTank);

 public List<OilTank>   selectOilTankListAll(OilTank oilTank);
    public List<OilTank> selectOilTankListOther(OilTank oilTank);
    /**
     * 新增储油罐信息
     * 
     * @param oilTank 储油罐信息
     * @return 结果
     */
    public int insertOilTank(OilTank oilTank);

    /**
     * 修改储油罐信息
     * 
     * @param oilTank 储油罐信息
     * @return 结果
     */
    public int updateOilTank(OilTank oilTank);

    /**
     * 删除储油罐信息
     * 
     * @param id 储油罐信息ID
     * @return 结果
     */
    public int deleteOilTankById(Long id);

    /**
     * 批量删除储油罐信息
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteOilTankByIds(Long[] ids);



    @Select("SELECT SUM(weight) AS total_weight " +
            "FROM oil_tank " +
            "WHERE dept_id = #{deptId} AND type_id != 3")
    BigDecimal getTotalWeightByDeptId(Long deptId);
}
